/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package model.dao;

import java.util.List;
import javax.persistence.Query;
import model.Participante;

/**
 *
 * @author Patrick
 */
public class ParticipanteDAO extends BaseDAO<Participante>{
    
    public List<Participante> pesquisaPorNome(String nome){
        Query query = getEntityManager().createQuery(
                "SELECT participante FROM  " + Participante.class.getName() + " participante WHERE participante.nome LIKE :nome");
        query.setParameter("nome", "%"+nome+"%"); 
        
        return (List<Participante>) query.getResultList();
    }
}
